//查询参数配置
export class QueryParamConfig {
    label?: string;//label
    prop?: string;
    width?: string = '90%'//列宽占比 默认90%
    placeholder?: string = ''
    customSlotName: string = "" //自定义插槽配置

    buildLabel(label: string): this {
        this.label = label
        return this
    }

    buildProp(prop: string): this {
        this.prop = prop
        return this
    }

    buildWidth(width: string): this {
        this.width = width
        return this
    }

    buildPlaceholder(placeholder: string) {
        this.placeholder = placeholder
        return this
    }

    buildCustomSlotName(customSlotName: string): this {

        this.customSlotName = customSlotName
        return this
    }
}

//表格数据项配置
export class TableListConfig {
    label?: string;//label
    prop?: string;
    width: string = "auto"; //宽度
    minWidth: string = "" // 最小宽度
    customSlotName: string = "" //自定义插槽配置
    buildLabel(label: string): this {
        this.label = label
        return this
    }

    buildProp(prop: string): this {
        this.prop = prop
        return this
    }

    buildWidth(width: string): this {
        this.width = width
        return this
    }

    buildMinWidth(minWidth: string): this {
        this.minWidth = minWidth
        return this
    }

    buildCustomSlotName(customSlotName: string): this {
        this.customSlotName = customSlotName
        return this
    }
}

export class PageParam<T> {
    param?: T;
    current: number = 1;
    size: number = 10

    buildParam(param: T): this {
        this.param = param
        return this
    }

    buildCurrent(current: number): this {
        this.current = current
        return this
    }

    buildSize(size: number): this {
        this.size = size
        return this
    }
}